package com.gather.hashsets;

import java.util.HashSet;

public class Example02 {
    public static void main(String[] args) {
        System.out.println("测试不重复添加元素");
        HashSet<String> stringHashSet = new HashSet<>();
        stringHashSet.add("jack");
        stringHashSet.add("luck");
        stringHashSet.add("key");
        stringHashSet.add("jack");
        System.out.println("stringHashSet "+stringHashSet); // stringHashSet [luck, jack, key]
    }
}
